import { ProfileType } from '@/store/reducer/user';
import request from '@/utils/request';

/** 获取用户个人资料API */
export const GetProfileApi = () => {
  return request({
    url: '/v1_0/user/profile',
  });
};

/** 获取用户自己信息API */
export const GetUserInfoApi = () => {
  return request({
    url: '/v1_0/user',
  });
};

/** 编辑用户信息API */
export const EditProfileApi = (data: ProfileType) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'patch',
    data,
  });
};

/** 上传图片头像Api */
export const UploadPhotoApi = (photo: any) => {
  return request({
    url: '/v1_0/user/photo',
    method: 'PATCH',
    data: photo,
  });
};
